import 'package:flutter/material.dart';
import 'package:kasax_demos2/appdemo/mybottomnavigationbar/my_bottom_nanvigationbar_demo_home.dart';
import 'package:kasax_demos2/appdemo/sbnb/bottomnavigationbar_demo_home.dart';
import 'package:kasax/commons/basic_listpage.dart';
import 'package:kasax/commons/common_entrys.dart';
import 'package:kasax/commons/commons.dart';
import 'package:kasax_demos2/day01_firststarup/custom_theme_demo.dart';
import 'package:kasax_demos2/day01_firststarup/listview_demo.dart';
import 'package:kasax_demos2/day01_firststarup/listview_demo2.dart';
import 'package:kasax_demos2/day01_firststarup/listview_demo3.dart';
import 'package:kasax_demos2/day01_firststarup/listview_item_event_demo1.dart';
import 'package:kasax_demos2/day01_firststarup/listview_item_event_demo2.dart';
import 'package:kasax_demos2/day01_firststarup/listview_item_event_demo3.dart';
import 'package:kasax_demos2/day01_firststarup/listview_scroll_demo.dart';
import 'package:kasax_demos2/day01_firststarup/listview_scroll_demo2.dart';
import 'package:kasax_demos2/day01_firststarup/new_slivers_demo.dart';
import 'package:kasax_demos2/day01_firststarup/new_slivers_demo2.dart';
import 'package:kasax_demos2/day01_firststarup/newlistview_demo.dart';
import 'package:kasax_demos2/day01_firststarup/textstyle_demo.dart';
import 'package:kasax_demos2/day02_uisctruct/appbar_demo.dart';
import 'package:kasax_demos2/day02_uisctruct/bottom_nav_bar_demo.dart';
import 'package:kasax_demos2/day02_uisctruct/drawer_demo.dart';
import 'package:kasax_demos2/day02_uisctruct/material_demo.dart';
import 'package:kasax_demos2/day02_uisctruct/tabbar_demo.dart';
import 'package:kasax_demos2/day02_uisctruct/tabbar_demo2.dart';
import 'package:kasax_demos2/day03_basicwidget/boxdecoration_demo.dart';
import 'package:kasax_demos2/day03_basicwidget/button_demo.dart';
import 'package:kasax_demos2/day03_basicwidget/container_demo.dart';
import 'package:kasax_demos2/day03_basicwidget/forms_demo.dart';
import 'package:kasax_demos2/day03_basicwidget/image_demo.dart';
import 'package:kasax_demos2/day03_basicwidget/richtext_demo.dart';
import 'package:kasax_demos2/day03_basicwidget/stack_demo.dart';
import 'package:kasax_demos2/day03_basicwidget/text_demo.dart';
import 'package:kasax_demos2/day04_layouts/aspectratio_demo.dart';
import 'package:kasax_demos2/day04_layouts/constrainedbox_demo.dart';
import 'package:kasax_demos2/day04_layouts/icon_badge_demo.dart';
import 'package:kasax_demos2/day04_layouts/row_and_column_demo.dart';
import 'package:kasax_demos2/day04_layouts/sizedbox_demo.dart';
import 'package:kasax_demos2/day05_widgets/customerscrollview_demo.dart';
import 'package:kasax_demos2/day05_widgets/customerscrollview_demo2.dart';
import 'package:kasax_demos2/day05_widgets/customscrollview_demo3.dart';
import 'package:kasax_demos2/day06_slivers/sliver_appbardemo2_home.dart';
import 'package:kasax_demos2/day06_slivers/sliver_appbardemo_home.dart';
import 'package:kasax_demos2/day06_slivers/sliver_demo4.dart';
import 'package:kasax_demos2/day06_slivers/sliver_demo_home2.dart';
import 'package:kasax_demos2/day06_slivers/sliver_griddemo_home.dart';
import 'package:kasax_demos2/day06_slivers/sliver_listdemo_home.dart';
import 'package:kasax_demos2/day07_routes/named_route_skip_demo.dart';
import 'package:kasax_demos2/day07_routes/route_intercept_demo.dart';
import 'package:kasax_demos2/day07_routes/sample_route_demo.dart';
import 'package:kasax_demos2/day07_routes/satandskip_demo.dart';
import 'package:kasax_demos2/day11_dialogs/alert_dialog_demo.dart';
import 'package:kasax_demos2/day11_dialogs/bottom_sheet_demo.dart';
import 'package:kasax_demos2/day11_dialogs/expansion_panel_demo.dart';
import 'package:kasax_demos2/day11_dialogs/simple_dialog_demo.dart';
import 'package:kasax_demos2/day11_dialogs/snackbar_demo.dart';
import 'package:kasax_demos2/day12_mdc/actionchip_demo.dart';
import 'package:kasax_demos2/day12_mdc/card_demo.dart';
import 'package:kasax_demos2/day12_mdc/chip_demo.dart';
import 'package:kasax_demos2/day12_mdc/choice_chip_demo.dart';
import 'package:kasax_demos2/day12_mdc/cliprrect_demo.dart';
import 'package:kasax_demos2/day12_mdc/datatable_demo.dart';
import 'package:kasax_demos2/day12_mdc/delete_chip_demo.dart';
import 'package:kasax_demos2/day12_mdc/delete_list_chip_demo.dart';
import 'package:kasax_demos2/day12_mdc/divider_demo.dart';
import 'package:kasax_demos2/day12_mdc/filterchip_demo.dart';
import 'package:kasax_demos2/day12_mdc/paginated_datatable_demo.dart';
import 'package:kasax_demos2/day12_mdc/stepper_demo.dart';
import 'package:kasax_demos2/day12_mdc/wrap_demo.dart';
import 'package:kasax_demos2/day13_statemanage/inheritedwidget_demo2_home.dart';
import 'package:kasax_demos2/day13_statemanage/inheritedwidget_demo3_home.dart';
import 'package:kasax_demos2/day13_statemanage/inheritedwidget_demo_home.dart';
import 'package:kasax_demos2/day13_statemanage/scopedmodel_home.dart';
import 'package:kasax_demos2/day13_statemanage/statefullwidget_demo_home.dart';
import 'package:kasax_demos2/day14_stream/stream_subscription_demo_home.dart';
import 'package:kasax_demos2/day14_stream/streambuilder_demo2_home.dart';
import 'package:kasax_demos2/day14_stream/streambuilder_demo3_home.dart';
import 'package:kasax_demos2/day14_stream/streambuilder_demo_home.dart';
import 'package:kasax_demos2/day14_stream/streamcontroller_demo_home.dart';
import 'package:kasax_demos2/day14_stream/sink_demo_home.dart';
import 'package:kasax_demos2/day14_stream/broadcast_streamcontroller_demo_home.dart';
import 'package:kasax_demos2/day14_stream/multi_subscription_broadcast_streamcontroller__demo_home.dart';
import 'package:kasax_demos2/day15_rxdart/rxdart_demo_home.dart';
import 'package:kasax_demos2/day16_bloc_provider/provider_demo_home.dart';
import 'package:kasax_demos2/day16_bloc_provider/provider_for_bottomnavigationbar_home.dart';
import 'package:kasax_demos2/day16_bloc_provider/provider_for_drawer_home.dart';
import 'package:kasax_demos2/day16_bloc_provider/sample_bloc_demo2_home.dart';
import 'package:kasax_demos2/day16_bloc_provider/sample_bloc_demo_home.dart';
import 'package:kasax_demos2/day16_bloc_provider/sample_provider_demo_home.dart';
import 'package:kasax_demos2/day16_flutterbloc/bloc_demo2_home.dart';
import 'package:kasax_demos2/day16_flutterbloc/bloc_demo_home.dart';
import 'package:kasax_demos2/day17_netrequest/dio_demo.dart';
import 'package:kasax_demos2/day17_netrequest/http_demo.dart';
import 'package:kasax_demos2/day17_netrequest/http_demo2.dart';
import 'package:kasax_demos2/day17_netrequest/http_demo3.dart';
import 'package:kasax_demos2/day18_anims/anim_curve.dart';
import 'package:kasax_demos2/day18_anims/anim_home.dart';
import 'package:kasax_demos2/day18_anims/anim_home2.dart';
import 'package:kasax_demos2/day18_anims/anim_home3.dart';
import 'package:kasax_demos2/day18_anims/anim_mylove.dart';
import 'package:kasax_demos2/day18_anims/anim_tween.dart';
import 'package:kasax_demos2/day18_anims/page_switch_anim_demo1.dart';
import 'package:kasax_demos2/exts/banner/banner_demo_home.dart';
import 'package:kasax_demos2/exts/blockrefresh/block_refresh_bloc.dart';
import 'package:kasax_demos2/exts/blockrefresh/block_refresh_callback.dart';
import 'package:kasax_demos2/exts/blockrefresh/block_refresh_globalkey.dart';
import 'package:kasax_demos2/exts/blockrefresh/block_refresh_inheritedwiget.dart';
import 'package:kasax_demos2/exts/blockrefresh/block_refresh_offset.dart';
import 'package:kasax_demos2/exts/blockrefresh/block_refresh_provider.dart';
import 'package:kasax_demos2/exts/blockrefresh/block_refresh_refreshable.dart';
import 'package:kasax_demos2/exts/blockrefresh/block_refresh_scopedmodel.dart';
import 'package:kasax_demos2/exts/easyrefresh/easyrefresh_demo_home.dart';
import 'package:kasax_demos2/exts/getx/sample_getx_demo_home.dart';
import 'package:kasax_demos2/exts/introslider/intro_slider_demo.dart';
import 'package:kasax_demos2/exts/introslider/intro_slider_demo2.dart';
import 'package:kasax_demos2/exts/introslider/intro_slider_demo3.dart';
import 'package:kasax_demos2/exts/introview/intro_view_demo.dart';
import 'package:kasax_demos2/exts/pull2refresh/pull2refresh_demo_home.dart';
import 'package:kasax_demos2/exts/refresh/refresh_demo_home.dart';
import 'package:kasax_demos2/exts/shimmer/shimmer_demo.dart';
import 'package:kasax_demos2/exts/shimmer/shimmer_demo2.dart';
import 'package:kasax_demos2/exts/splashwidget/splash_page_demo.dart';
import 'package:kasax_demos2/exts/swiper/swiper_demo_home.dart';
import 'package:kasax_demos2/exts/widgetspan/widgetspan_demo.dart';
import 'package:kasax_demos2/gankio/grils_demo_home.dart';
import 'package:kasax_demos2/meiyingfilm/movie_demo_home.dart';
import 'package:kasax_demos2/gankio/grils_demo_home.dart';
import 'package:kasax_demos2/pratacties/douban/app_douban.dart';
import 'package:kasax_demos2/smallapps/account_center_demo.dart';
import 'package:kasax_demos2/smallapps/account_service_center_demo.dart';
import 'package:kasax_demos2/smallapps/dashboard_demo.dart';
import 'package:kasax_demos2/smallapps/namecard_demo.dart';
import 'package:kasax_demos2/smallapps/pinterest_home_demo.dart';
import 'package:kasax_demos2/smallapps/pinterest_texty_demo.dart';
import 'package:kasax_demos2/widgets/place_widget.dart';
import 'package:kasax_demos2/day05_widgets/gridview_demo.dart';
import 'package:kasax_demos2/day05_widgets/pageview_demo.dart';
import 'package:kasax_demos2/day05_widgets/pageview_demo2.dart';
import 'package:kasax_demos2/day15_rxdart/behavior_subject_demo_home.dart';
import 'package:kasax_demos2/day15_rxdart/publish_subject_demo_home.dart';
import 'package:kasax_demos2/day15_rxdart/replay_subject_demo_home.dart';
import 'package:kasax_demos2/day15_rxdart/rxdart_operator_demo_home.dart';
import 'package:kasax_demos2/day15_rxdart/sample_ui_with_rxdart_demo_home.dart';
import 'package:kasax_demos2/day16_getx/getx_demo_home.dart';
import 'package:kasax_demos2/day16_getx/sample_binding.dart';
import 'package:kasax_demos2/day16_getx/sample_demo_getx_controller.dart';
import 'package:kasax_demos2/day16_getx/sample_getview.dart';
import 'package:kasax_demos2/day16_getx/sample_getwidget.dart';
import 'package:kasax_demos2/day16_getx/sample_getx_controller.dart';
import 'package:kasax_demos2/day16_getx/sample_getxcontroller_block_refresh.dart';
import 'package:kasax_demos2/day16_getx/sample_getxcontroller_sm.dart';
import 'package:kasax_demos2/day16_getx/sample_newslist.dart';
import 'package:kasax_demos2/day16_getx/sample_optm_getxcontroller_demo.dart';

/// 数据提供工厂
/// 数据提供工厂
class BeansFactory {
  static final BeansFactory _instance = BeansFactory._internal();

  BeansFactory._internal();

  factory BeansFactory() => _instance;

  static BeansFactory getInstance() {
    return _instance;
  }

  List<PageInfo> buildMainList() {
    Map<String, Widget> map = {
      "NinghaoFlutter": buildNinghaoList(),
      "Flutter实践练习": buildFlutterPractice(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return infos;
  }

  Widget buildFlutterPractice() {
    Map<String, Widget> map = {
      "Flutter实例练习": buildAppDemoList(),
      "Flutter小实战练习": buildAppDemoList(),
      "技能扩展": buildExtsDemoList(),
      "小程序-小影": MeiyFilmDemo(),
      "小程序-妹子": MeiZiDemoHome(),
      "小程序-豆瓣": AppDouban(),
      "小程序-简书案例": buildJiansList(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "Flutter深入");
  }

  /// 网络请求
  Widget buildNetRequestList() {
    Map<String, Widget> map = {
      "Http请求": HttpDemo(),
      "Http请求-2": HttpDemo2(),
      "Http请求-3": HttpDemo3(),
      "Dio请求": DioDemo(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos.add(PageInfo(buildBasicUIPage(value, key), title: key));
      // infos.add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "网络请求");
  }

  /// 网络请求
  Widget buildSliversList() {
    Map<String, Widget> map = {
      "SliverList": SliverListDemoHome(),
      "SliverGrid": SliverGridDemoHome(),
      "SliverGrid2": SliverDemoHome2(),
      "SliverAppBar": SliverAppbarDemo(),
      "带渐近动画的可伸缩空间": SliverAppbarDemo2(),
      "NewSliver-1": NewSliverDemo1Home(),
      "NewSliver-2": NewSliverDemo2Home(),
      "NewSliver-3": NewSliverDemo03(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos.add(PageInfo(buildBasicUIPage(value, key, showAppbar: false),
          title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "Sliver");
  }

  Widget buildAnimList() {
    // 原始方式
    // List<PageInfo> pageInfo = [
    //   PageInfo(buildBasicUIPage(AnimHomeWidget(), "基本使用"), title: "基本使用"),
    //   PageInfo(buildBasicUIPage(AnimTweenWidget(), "Tween动画"),
    //       title: "Tween动画"),
    //   PageInfo(buildBasicUIPage(AnimCurveWidget(), "Curve动画曲线"),
    //       title: "Curve动画曲线"),
    //   PageInfo(buildBasicUIPage(AnimMyLoveWiget(), "自定义动画"), title: "自定义动画"),
    // ];

    // 新方式
    Map<String, Widget> map = {
      "基本使用": AnimHomeWidget(),
      "基本使用-2": AnimHomeWidget2(),
      "基本使用-3": AnimHomeWidget3(),
      "Tween动画": AnimTweenWidget(),
      "Curve动画曲线": AnimCurveWidget(),
      "自定义动画": AnimMyLoveWiget(),
      "界面切换动画": buildPageSwitchWidge(),
      "动画示例系列-老孟": buildLMAnimList(),
      "动画示例系列-阿策小和尚": buildAcHsAnimList(),
    };

    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos.add(PageInfo(buildBasicUIPage(value, key), title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "动画");
  }

  /// 和尚动画系列
  Widget buildAcHsAnimList() {
    Map<String, Widget> map = {
      "基本动画使用-和尚": PlaceholderView(),
      "基本隐式动画使用-和尚": PlaceholderView(),
      "帧动画-和尚": PlaceholderView(),
      "自定义跑马灯动画-和尚": PlaceholderView(),
      "Lottie使用-和尚": PlaceholderView(),
      "Flare使用-和尚": PlaceholderView(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos.add(PageInfo(buildBasicUIPage(value, key), title: key));
    });
    return BasicLoadingListWidget(infos);
  }

  /// 老孟动画系列
  Widget buildLMAnimList() {
    Map<String, Widget> map = {
      "Tween": PlaceholderView(),
      "Curve": PlaceholderView(),
      "TweenSequeue动画序列": PlaceholderView(),
      "AnimatedList": PlaceholderView(),
      "Hero": PlaceholderView(),
      "Material motion": PlaceholderView(),
      "案例-路由动画": PlaceholderView(),
      "案例-孔雀开屏": PlaceholderView(),
      "案例-渐变进度圆环": PlaceholderView(),
      "案例-仿掘金点赞": PlaceholderView(),
      "案例-酷炫3D效果": PlaceholderView(),
      "案例-翻书效果": PlaceholderView(),
      "案例-涟漪效果": PlaceholderView(),
      "案例-雷达扫描效果": PlaceholderView(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos.add(PageInfo(buildBasicUIPage(value, key), title: key));
    });
    return BasicLoadingListWidget(infos);
  }

  Widget buildPageSwitchWidge() {
    return BasicLoadingListWidget(buildPageSwitchAnim());
  }

  List<PageInfo> buildPageSwitchAnim() {
    Map<String, Widget> map = {
      "界面切换动画-1": PageSwitchDemo1(),
      "界面切换动画-2": PlaceholderView(),
      "界面切换动画-3": PlaceholderView(),
      "界面切换动画-4": PlaceholderView(),
      "界面切换动画-5": PlaceholderView(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return infos;
  }

  buildFirstStartupList() {
    Map<String, Widget> map = {
      "TextStyle示例": TextStyleDemo(),
      "自定义主题": CustomThemeDemo(),
      "ListView": ListViewDemo(),
      "ListView示例": ListViewDemo2(),
      "ListView示例2": ListViewDemo3(),
      "ListView示例3": NewListViewDemo(),
      "ListView滚动监听-1": ListViewScrollDemo(),
      "ListView滚动监听-2": ListViewScrollDemo2(),
      "条目事件-GestureDetector": ListViewItemEventDemo1(),
      "条目事件-InkWell": ListViewItemEventDemo2(),
      "条目事件-FlatButton": ListViewItemEventDemo3(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "快速起步");
  }

  buildUIStructList() {
    Map<String, Widget> map = {
      "Appbar": AppbarDemo(),
      "TabBar": TabbarDemo(),
      "TabBar2": TabbarDemo2(),
      "Material": MaterialDemo(),
      "Drawer": DrawerDemo(),
      "BottomNavigationBar": BottomNavigationBarDemo(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "界面结构");
  }

  buildBasicUIList() {
    Map<String, Widget> map = {
      "Text": TextDemo(), // changed
      "RichText": RichTextDemo(), // changed
      "Container": ContainerDemo(),
      "BoxDecoration": BoxDecorationDemo(),
      "图片": ImagesDemoHome(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "界面基础");
  }

  buildLayoutsList() {
    Map<String, Widget> map = {
      "图标徽章": IconBadgeDemo(),
      "Row&Column": RowAndColumnDemo(),
      "SizedBox": SizedBoxDemo(),
      "AspectRatio": AspectRatioDemo(),
      "ConstrainedBox": ConstrainedBoxDemo(),
      "Stack": StackDemoHome(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos.add(PageInfo(buildBasicUIPage(value, key), title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "布局");
  }

  buildNinghaoList() {
    Map<String, Widget> map = {
      "快速起步": buildFirstStartupList(),
      "页面结构": buildUIStructList(),
      "基础部件": buildBasicUIList(),
      "布局": buildLayoutsList(),
      "视图": buildWidgetList(),
      "Sliver": buildSliversList(),
      "路由": buildRoutesList(),
      "按钮": ButtonDemoHome(),
      "输入": FormsDemoHome(),
      "对话框": buildDialogsList(),
      "MDC": buildMDCList(),
      "状态管理": buildStateManagementList(),
      "网络请求": buildNetRequestList(),
      "动画": buildAnimList(),
      "国际化": PlaceholderView(),
      "测试": PlaceholderView(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "NinghaoFlutter");
  }

  /// 对话框
  Widget buildDialogsList() {
    Map<String, Widget> map = {
      "Snackbar": SnackbarDemo(),
      "SimpleDialog": SimpleDialogDemo(),
      "AlertDialog": AlertDialogDemo(),
      "BottomSheet": BottomSheetDemo(),
      "ExpansionPanel": ExpansionPanelDemo(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      if (key != "BottomSheet") {
        infos.add(PageInfo(buildBasicUIPage(value, key), title: key));
      } else {
        infos.add(PageInfo(value == null ? Center() : value, title: key));
      }
    });
    return BasicLoadingListWidget(infos);
  }

  buildStateManagementList() {
    Map<String, Widget> map = {
      "State": buildStatesList(),
      "Provider": buildProviderList(),
      "GetX": buildGetXList(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "状态管理");
  }

  buildStatesList() {
    Map<String, Widget> map = {
      "InheritedWidget": buildInheritedWidgetList(),
      "Stream": buildStreamList(),
      "RxDart": buildRxdartList(),
      "BLoC": buildBlocList(),
      "flutter_bloc": buildFlutterBlocList(),
      "FlutterRedux": PlaceholderView(),
      "FishRedux": PlaceholderView(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "状态管理-State");
  }

  buildBlocList() {
    Map<String, Widget> map = {
      "Bloc1": SampleBloCDemoHome(),
      "Bloc2": SampleBloCDemo2Home(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "Bloc示例");
  }

  buildFlutterBlocList() {
    Map<String, Widget> map = {
      "FlutterBloc-1": FlutterBlocDemoHome(),
      "FlutterBloc-2": FlutterBlocDemo2Home(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "FlutterBloc示例");
  }

  buildAppDemoList() {
    Map<String, Widget> map = {
      "BottomNavigationbar示例": BottomNavigationbarDemoHome(),
      "不规则底部导航": MyBottomNavigationbarDemoHome(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "界面基础");
  }

  buildInheritedWidgetList() {
    Map<String, Widget> map = {
      "StateFullWidget基本示例": SampleStateFullWidget(),
      "InheritedWidget": SampleInheritedWidget(),
      "InheritedWidget2": SampleInheritedWidget2(),
      "InheritedWidget3": SampleInheritedWidget3(),
      "ScopedModel": ScopedModelWidget(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "InheritedWidget示例");
  }

  buildStreamList() {
    Map<String, Widget> map = {
      "Stream基本使用": StreamSubscriptionDemoHome(),
      "StreamController": StreamControllerDemoHome(),
      "Stream-Sink": SinkDemoHome(),
      "StreamController.broadcast多次订阅": BroadcastStreamControllerDemoHome(),
      "StreamController.broadcast多次订阅-2":
          MultiSubscriptionBroadcastStreamControllerDemoHome(),
      "StreamBuilder": StreamBuilderDemoHome(),
      "StreamBuilder2": StreamBuilderDemo2Home(),
      "StreamBuilder3": StreamBuilderDemo3Home(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "Stream示例");
  }

  buildRxdartList() {
    Map<String, Widget> map = {
      "Observable使用": PlaceholderView(),
      "PublishSubject使用": PublishSubjectDemoHome(),
      "BehaviorSubject使用": BehaviorSubjectDemoHome(),
      "ReplaySubject使用": ReplaySubjectDemoHome(),
      "常用操作符": RxDartOperatorDemoHome(),
      "常用操作符-2": PlaceholderView(),
      "动态列表生成": SampleUiWithRxDartDemoHome(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "RxDart示例");
  }

  buildProviderList() {
    Map<String, Widget> map = {
      "Provider基本使用": SampleProviderDemoHome(),
      "Provider计数器练习": ProviderDemoHome(),
      "Provider管理Drawer": ProviderForDrawerDemoHome(),
      "Provider管理底部导航": ProviderForBottomNavigationBarDemoHome(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "Provider示例");
  }

  buildGetXList() {
    Map<String, Widget> map = {
      "GetX基本使用": SampleGetXHome(),
      "GetxController-响应式状态管理": SampleGetXControllerHome(),
      "GetxController-简单状态管理": SampleGetXControllerSMHome(),
      "GetxController-指定id刷新": SampleGetXControllerBlocRefreshHome(),
      "GetxController-跨界面交互": SampleDemoGetXController(),
      "GetxController-架构优化": SampleOptmGetxControllerHome(),
      "Binding": SampleBindingHome(),
      "GetView": SampleGetViewHome(),
      "GetWidget": SampleGetWidgetHome(),
      "完整案例": SampleNewsListHome(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "GetX示例");
  }

  buildExtsDemoList() {
    Map<String, Widget> map = {
      "轮播图": BannerDemoHome(),
      "轮播图-flutter swiper": SwiperDemoHome(),
      "自定义轮播": PlaceholderView(),
      "列表刷新-1 传统": RefreshDemoHome(),
      "列表刷新-2 easy-refresh": EasyRefreshDemoHome(),
      "列表刷新-2 pull-to-refresh": Pull2RefreshDemoHome(),
      "局部刷新-回调接口": BlockRefreshWithCallback(),
      "局部刷新-GlobalKey": BlockRefreshWithGlobalkey(),
      "局部刷新-Refreshable": BlockRefreshWithRefreshableView(),
      "局部刷新-Provider": BlockRefreshWithProvider(),
      "局部刷新-Bloc": BlockRefreshWithBloc(),
      "局部刷新-Offset": BlockRefreshWithOffset(),
      "局部刷新-InherWidget": BlockRefreshWithInheritedWidget(),
      "局部刷新-Scoped Model": BlockRefreshWithScopedModel(),
      "GetX示例": GetXDemoHome(),
      "Shimmer示例": ShimmerDemo(),
      "Shimmer示例2": ShimmerDemo2(),
      "WidgetSpan": WidgetSpanDemo(),
      "首屏动画": SplashPageDemo(),
      "开场介绍-InteroView": InteroViewsDemo(),
      "开场介绍-IntroSlider": IntroSliderDemo(),
      "开场介绍-IntroSlider2": IntroSliderDemo2(),
      "开场介绍-IntroSlider3": IntroSliderDemo3(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "扩展练习");
  }

  buildWidgetList() {
    Map<String, Widget> map = {
      "PageView": PageViewDemo(),
      "PageView2": PageViewDemo2(),
      "CustomerView": CustomerViewDemo(),
      "CustomerView2": CustomerViewDemo2(),
      "CustomerView3": CustomerScrollViewDemo3(),
      "GridView": GridViewDemo(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "视图");
  }

  buildMDCList() {
    Map<String, Widget> map = {
      "Chip": ChipDemo(),
      "Wrap": WrapDemo(),
      "Divider": DividerDemo(),
      "Chip-带删除功能": DeleteChipDemo(),
      "Chip-列表功能带删除": DeleteListChipDemo(),
      "ActionChip": ActionChipDemo(),
      "FilterChip": FilterChipDemo(),
      "ChoiceChip": ChoiceChipDemo(),
      "DataTable": DatatableDemo(),
      "PaginatedDataTable": PaginatedDatatableDemo(),
      "Card": CardDemo(),
      "ClipRRect": ClipRRectDemo(),
      "Stepper": StepperDemo(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "MDC");
  }

  buildRoutesList() {
    Map<String, Widget> map = {
      "SampleRouteDemo": SampleRouteDemo(),
      "标准跳转": StandSkipDemo(),
      "带名字路由跳转": NamedRouteSkipDemo(),
      "路由拦截": RouteInterceptDemo(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "路由");
  }

  buildJiansList() {
    Map<String, Widget> map = {
      "个人名片": NamedCardDemo(),
      "Dashboard": DashboardDemo(),
      "Pinterest": PinterestHomeDemo(),
      "Texty": PinterestTextyDemo(),
      "账户中心": AccountCenterDemo(),
      "客服中心": UserAccountServiceCenterDemo(),
    };
    List<PageInfo> infos = <PageInfo>[];
    map.forEach((key, value) {
      infos
          .add(PageInfo(value == null ? PlaceholderView() : value, title: key));
    });
    return buildBasicUIPage(BasicLoadingListWidget(infos), "简书示例");
  }
}
